﻿#ifndef LOADINGLABEL_H
#define LOADINGLABEL_H

#include <QLabel>
#include <QObject>
#include<QDebug>
#include <QWidget>
#include <QPropertyAnimation>
#include<QPixmap>
class LoadingLabel : public QLabel
{
    Q_OBJECT
    // 声明属性
    Q_PROPERTY(int pixmap_ READ pixmap_ WRITE setPixmap_index)
public:
    LoadingLabel(QWidget *parent = nullptr);
    void startAnimation_();//播放动画
    void stopAnimation_(); //关闭动画
    int  pixmap_() const;
    void setPixmap_index(const int &index); //设置播放的图片编号
    void setPixmapPath(const QString &pixmapPath, int pixmapCnt);//设置图片文件夹路径
public:
    QString m_pixmapPath; //动画图片路径
    QPropertyAnimation *m_pAnimation;
    int m_nIndex;//图片标号
    int m_pixmapCnt;
};

#endif // LOADINGLABEL_H
